<template>
    <p>这是一个Product页面</p>
</template>

<script>
export default {
    watch:{
        $route(newVal, aldVal){
            console.log('newVal,newVal');
            console.log('oldVal,oldVal');

            this.init()
        },
    },
    methods:{
        init(){
            console.log("初始化数据");
            console.log("现在的id是"+this.$route.params.id);
        },
    },
    mounted() {
        console.log(this.$route);;
    },
}
</script>

<style scoped></style>